cmake_minimum_required(VERSION 3.15)

project(
    OpenGLStudy
    VERSION 0.1.0
    LANGUAGES CXX C
)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
    set(ARCHITECTURE "aarch64")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
    set(ARCHITECTURE "arm64")
else()
    if (CMAKE_SIZEOF_VOID_P EQUAL 8)
        set(ARCHITECTURE "64")
    else()
        set(ARCHITECTURE "32")
    endif()
endif()

set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/install)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SYSTEM_NAME}-x${ARCHITECTURE})

set(DEBUG_POSTFIX "d")
set(RELEASE_POSTFIX "")

set(CMAKE_DEBUG_POSTFIX ${DEBUG_POSTFIX})
set(CMAKE_RELEASE_POSTFIX ${RELEASE_POSTFIX})

add_subdirectory(glfw-3.3.8)
add_subdirectory(glew-2.1.0/build/cmake)
add_subdirectory(HelloOpenGL)